<template>
  <div class="base-properties">
    <el-form label-position="top">
      <!-- 栅格配置 -->
      <el-form-item label="栅格宽度">
        <el-slider
          v-model="properties.span"
          :min="1"
          :max="24"
          :marks="{
            1: '1',
            6: '6',
            12: '12',
            18: '18',
            24: '24'
          }"
          @change="updateProperties" />
      </el-form-item>
      
      <!-- 其他属性配置 -->
      <slot></slot>
    </el-form>
  </div>
</template>

<script setup>
import { ref, watch } from 'vue'

const props = defineProps({
  value: {
    type: Object,
    required: true
  }
})

const emit = defineEmits(['update'])

const properties = ref({
  span: 24,
  ...props.value
})

watch(() => props.value, (newVal) => {
  properties.value = {
    span: 24,
    ...newVal
  }
}, { deep: true })

const updateProperties = () => {
  emit('update', { ...properties.value })
}
</script> 